# Maintainer: Sébastien Luttringer

pkgname=python-psutil
pkgver=5.9.6
pkgrel=1
arch=('loong64' 'x86_64')
pkgdesc='A cross-platform process and system utilities module for Python'
url='https://github.com/giampaolo/psutil'
license=('custom: BSD')
depends=('python')
makedepends=('python-setuptools')
checkdepends=('net-tools' 'procps-ng' 'python-pytest')
source=("https://github.com/giampaolo/psutil/archive/release-$pkgver.tar.gz")
sha512sums=('716a39e5a5e278717a14b74786f8b941f0b4335f6e0c4de338346b825925e8793315f41908ec10bbb97ed6f9a9e5ffca27e031377025f03d73300876b9ff60e8')

build() {
  cd psutil-release-$pkgver

  python setup.py build --build-lib=build/python
}

check() {
  cd psutil-release-$pkgver

  # Required for testing
#cp setup.py build/python
#cp -r scripts build/python/

# 4 non-working tests in build chroot, requires fixes. Test framework does not allow exclusion.
#  PYTHONPATH="$PWD/build/python" python psutil/tests/__main__.py
}

package() {
  cd psutil-release-$pkgver
  python setup.py build --build-lib=build/python \
                  install --root="$pkgdir" --optimize=1
  install -D -m 644 LICENSE "$pkgdir/"usr/share/licenses/$pkgname/LICENSE
}

# vim:set ts=2 sw=2 et:
